package Xiaofang;

import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.util.Properties;
//Property用法
public class Work02 {
    public static void main(String[] args) {
        Properties pr=new Properties();
        pr.setProperty("xiao","方");
        pr.setProperty("wang","王");
        pr.setProperty("liu","值");
        Writer w=null;
        try {
            w=new FileWriter("D:\\Xiaofang\\xiaofang.txt");
            pr.store(w,"hello");
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                w.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
